import BaseEnums from "../BaseEnums";

class ConnectSourceOperationEnum extends BaseEnums {
    public static closeConnection: ConnectSourceOperationEnum =
        new ConnectSourceOperationEnum("closeConnection", "关闭链接", 1)
    public static openConnect: ConnectSourceOperationEnum =
        new ConnectSourceOperationEnum("openConnect", "打开链接", 2)
    public static editConnection: ConnectSourceOperationEnum =
        new ConnectSourceOperationEnum("editConnection", "编辑链接", 3)
    public static createDatabase: ConnectSourceOperationEnum =
        new ConnectSourceOperationEnum("createDatabase", "创建数据库", 4)
    public static deleteConnect: ConnectSourceOperationEnum =
        new ConnectSourceOperationEnum("deleteConnect", "删除连接", 5)

    public static getCloseConnectOperation() {
        return [
            {
                label: ConnectSourceOperationEnum.closeConnection.title,
                key: ConnectSourceOperationEnum.closeConnection.code,
                show: true
            },
            {
                label: '编辑链接',
                key: ConnectSourceOperationEnum.editConnection.code,
                show: true
            },
            {
                label: '创建数据库',
                key: ConnectSourceOperationEnum.createDatabase.code,
                show: true
            },
            {
                label: '删除连接',
                key: ConnectSourceOperationEnum.deleteConnect.code,
                show: true
            }
        ]
    }

    public static getOpenConnectOperation() {
        return [
            {
                label: '打开链接',
                key: ConnectSourceOperationEnum.openConnect.code,
                show: true
            },
            {
                label: '编辑链接',
                key: ConnectSourceOperationEnum.editConnection.code,
                show: true
            },
            {
                label: '删除连接',
                key: ConnectSourceOperationEnum.deleteConnect.code,
                show: true
            }
        ]
    }
}
export default  ConnectSourceOperationEnum